Append a new itemΒΆ
A.append(N)
Append a new item to the end of the array.
from array import *
AI = array('i', [1, 3, 5, 7, 9])
print("Original array: " + str(AI))
# Original array: array('i', [1, 3, 5, 7, 9])
print("Append 11 at the end of the array:")
# Append 11 at the end of the array:
AI.append(11)
print("New array: " + str(AI))
# New array: array('i', [1, 3, 5, 7, 9, 11])
See also: https://www.w3resource.com/python-exercises/array/python-array-exercise-2.php